package com.jrx.anytxn.transaction.mapper.ext;

import com.jrx.anytxn.transaction.entity.TlLoanStagingMapping;
import org.apache.ibatis.annotations.Param;

import java.util.Date;
import java.util.List;

public interface ExtTlLoanStagingMappingMapper {

    /**
     * 批量关联关系表
     *
     * @param tlLoanStagingMappingList
     */
    void insertTlLoanStagingMappingList(List<TlLoanStagingMapping> tlLoanStagingMappingList);

    /**
     * 批量获取待处理关联关系表
     */
    List<String> selectByBatch(@Param(value = "sumStatus")String sumStatus, @Param(value = "grayVersion")String grayVersion);

    List<TlLoanStagingMapping> selectByStagingLoanId(@Param(value = "stagingLoanId") String stagingLoanId);

    int updateByStagingLoanId(@Param(value = "tenantId")String tenantId,
                              @Param(value = "customerId")String customerId,
                              @Param(value = "stagingLoanId")String stagingLoanId,
                              @Param(value = "sumStatus")String sumStatus);


    List<String> selectByCustomerIdAndSumStatus(@Param(value = "customerId")String customerId,
                                                @Param(value = "sumStatus")String sumStatus,
                                                @Param(value = "tenantId")String tenantId);


    List<String> selectByCustomerIdAndBusinessDate(@Param(value = "customerId")String customerId,
                                                   @Param(value = "tenantId")String tenantId,
                                                   @Param(value = "startDate")String startDate,
                                                   @Param(value = "endDate")String endDate);

    List<TlLoanStagingMapping> selectByStagingLoanIdByMis(@Param(value = "stagingLoanId") String stagingLoanId,
                                                          @Param(value = "tenantId")String tenantId);

    List<TlLoanStagingMapping> selectByCustIdAndStagingLoanId(@Param(value = "customerId") String customerId,
                                                              @Param(value = "tenantId")String tenantId,
                                                              @Param(value = "loanId") String loanId);

    List<TlLoanStagingMapping> selectByStagingLoanIdByCusId(@Param(value = "customerId") String customerId,
                                                          @Param(value = "tenantId")String tenantId,
                                                            @Param(value = "loanId") String loanId);

    List<TlLoanStagingMapping> selectByBatchByBusinessDate(@Param(value = "businessDate") Date businessDate,
                                                           @Param(value = "sumStatus")String sumStatus);

    TlLoanStagingMapping selectByCustIdAndOrigLoanId(@Param(value = "customerId") String customerId,
                                                              @Param(value = "tenantId")String tenantId,
                                                              @Param(value = "originalLoanId") String originalLoanId);


}
